﻿using System;

namespace ReadyApps.Common.Exceptions
{
    /// <summary>
    /// Represents the error that occurs when an invalid enumeration value is used.
    /// </summary>
    public class InvalidEnumerationValueException : Exception
    {
        /// <summary>
        /// Initializes a new <see cref="InvalidEnumerationValueException"/> with the provided
        /// enumeration type and value.
        /// </summary>
        /// <param name="enumerationType">The <see cref="Type"/> of the enumeration attempting
        /// to be used.</param>
        /// <param name="value">The value that was attempting to be used.</param>
        public InvalidEnumerationValueException(Type enumerationType, object value)
            : base(string.Format("Invalid enumeration value [{0}] for enumeration '{1}'",
                value, enumerationType.FullName)) { }
    }
}
